package com.zy.batiya.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zy.batiya.domain.Menu;
import com.zy.batiya.service.MenuService;
import com.zy.batiya.util.CommonUtils;


/**
 * 左侧菜单
 * */
@Controller
public class MenuController {

	@Autowired
	private MenuService service;
	
	@ResponseBody
	@RequestMapping(value = "/menu")
	public String getMenu(){
		List<Menu> list = null;
		try{
			list = service.getMenuList();
		}catch(Exception e){
			e.printStackTrace();
		}
		return CommonUtils.successResult(list);
	}
}
